home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Franz PD
/
Franz PD Disk #047 (1990)(Amiga User Group Deutschland e.V.)[v Disaster Master 2].zip
/
Franz PD Disk #047 (1990)(Amiga User Group Deutschland e.V.)[v Disaster Master 2].adf
/
A68K_Beispiele
/
GetReal.asm
< prev
next >
Wrap
Assembly Source File
|
1989-07-02
|
2KB
|
90 lines
*
* Opens window , writes text (pointer to in a0, length in d0)
* inputs a real number and converts it to
* floating point format
*
* If d1 = 0 all is well and the number is in d0
* If d1 <> 0 something went wrong
*
* written by E. Lenz
* Johann-Fichte-Strasse 11
* 8 Munich 40
* Germany
XDEF GetReal
XREF RealIn
***** exec ****
_AbsExecBase equ 4
_LVOCloseLibrary equ -$19e
_LVOOpenLibrary equ -$228
**** dos ****
_LVOOpen equ -$1e
_LVOClose equ -$24
_LVORead equ -$2a
_LVOWrite equ -$30
GetReal move.l a6,-(a7)
movem.l d0/a0,-(a7)
move.l _AbsExecBase,a6
lea DosName(pc),a1 Open dos.library
moveq #0,d0
jsr _LVOOpenLibrary(a6)
move.l d0,d4
beq.s exit
move.l #cname,d1
movea.l d4,a6
move.l #$3ed,d2 Open for read + write
jsr _LVOOpen(a6)
move.l d0,a3
beq.s exit
move.l d0,d1
movem.l (a7)+,d2-d3
exg d2,d3
jsr _LVOWrite(a6)
move.l a3,d1
move.l #Buffer,d2
moveq #60,d3
jsr _LVORead(a6)
move.l a3,d1
jsr _LVOClose(a6)
lea Buffer(pc),a0
cmpi.b #$a,(a0)
bne.s noReturn
moveq #1,d1 Return input
bra.s exit
noReturn jsr RealIn
exit movem.l d0-d1,-(a7)
movea.l _AbsExecBase,a6
tst.l d4
beq.s NoDos
movea.l d4,a1 Close dos lib
jsr _LVOCloseLibrary(a6)
NoDos movem.l (a7)+,d0-d1
move.l (a7)+,a6
rts
Buffer ds.b 80
cname dc.b 'CON:100/100/200/100/Real input',0
even
DosName dc.b 'dos.library',0
even
end